package com.ztgf.commodity.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.commodity.models.bo.CommodityCategoryBO;
import com.ztgf.commodity.models.dto.CommodityCategoryDTO;
import com.ztgf.commodity.models.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-05-25 11:17
 * Description:
 */
@Mapper
public interface CommodityCategoryMapper extends BaseMapper<CommodityCategoryDTO> {

    /**
     * description: 后台管理系统查看类目详情
     * param: [id]
     * author: chenyu.wang
     * date: 2020-07-08
     * return: com.ztgf.commodity.models.vo.CommodityAdminCategoryDetailsVO
     */
    CommodityAdminCategoryDetailsVO getAdminDetailsById(@Param("id") Long id);

    /**
     * description: 后台管理系统佣金管理列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-08
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategoryBrokerageVO>
     */
    List<CommodityCategoryBrokerageVO> queryAdminBrokerageList(Page<CommodityCategoryBrokerageVO> page, @Param("item") CommodityCategoryBO bo);

    /**
     * description: 查询店铺所属类目
     * param: [shopId]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopCategoryVO>
     */
    List<CommodityShopCategoryVO> queryShopCategory(@Param("shopId") Long shopId);

    /**
     * description: 查询店铺所属类目,根据店铺id和类目名称
     * param: [shopId]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopCategoryVO>
     */
    List<CommodityShopCategoryVO> queryShopCategoryByCid(@Param("shopId") Long shopId,@Param("cid") String cid);

    /**
     * description: 查询店铺可售区域
     * param: [shopId]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopAvailableAreaVO>
     */
    List<CommodityShopAvailableAreaVO> queryShopAvailableArea(@Param("shopId") Long shopId);

    /**
     * description: 根据类目id查询关联的单位
     * param: [categoryId]
     * author: chenyu.wang
     * date: 2020-07-28
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategoryUnitVO>
     */
    List<CommodityCategoryUnitVO> queryUnitByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * description: 根据类目id查询关联的盾构品牌
     * param: [categoryId]
     * author: chenyu.wang
     * date: 2020-07-28
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategoryShieldBrandVO>
     */
    List<CommodityCategoryShieldBrandVO> queryShieldByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * description: 根据类目id查询关联的盾构部位
     * param: [categoryId]
     * author: chenyu.wang
     * date: 2020-07-28
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategoryShieldPartsVO>
     */
    List<CommodityCategoryShieldPartsVO> queryShieldPartByCategoryId(@Param("categoryId") Long categoryId);

    /*
     * @description:根据类目id查询关联的筛选属性
     * @author: chenyu.wang
     * @date: 2020-09-07
     */
    List<CommodityCategoryShieldPartsVO> queryFilterByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * description: 根据类目id查询关联的规格
     * param: [categoryId]
     * author: chenyu.wang
     * date: 2020-07-28
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategorySpecificationVO>
     */
    List<CommodityCategorySpecificationVO> queryCategorySpecification(@Param("categoryId") Long categoryId);

    /**
     * description: 根据类目id查询关联的参数信息
     * param: [categoryId]
     * author: chenyu.wang
     * date: 2020-07-28
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityCategoryParametricVO>
     */
    List<CommodityCategoryParametricVO> queryCategoryParame(@Param("categoryId") Long categoryId);

    /**
     * description: 查询店铺所属类目,根据品牌id
     * param: [brandId]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopCategoryVO>
     */
    List<CommodityShopCategoryVO> queryShopCategoryByBrandId(@Param("brandId") Long brandId, @Param("shopId") Long shopId);

    /*
     * @description:判断一个类目是否处于最低级，如果为空，则是最低级，反则不是
     * @author: chenyu.wang
     * @date: 2020-09-09
     */
    CommodityCategoryDTO getCheckCategory(@Param("categoryId") Long categoryId);

    /*
     * @description:根据类目id查询关联的品牌
     * @author: chenyu.wang
     * @date: 2020-09-09
     * @return:
     */
    List<CategoryBrandVO> queryBrandByCategoryId(@Param("categoryId") Long categoryId);

    /*
     * @description:查询类目品牌规格属性
     * @author: chenyu.wang
     * @date: 2020-09-09
     * @return:
     */
    List<CategoryBrandAttributesVO> queryCategoryBrandSpecification(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);

    /*
     * @description:查询类目品牌参数属性
     * @author: chenyu.wang
     * @date: 2020-09-09
     * @return:
     */
    List<CategoryBrandAttributesVO> queryCategoryBrandParam(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);

    /*
     * @description:查询类目品牌单位属性
     * @author: chenyu.wang
     * @date: 2020-09-09
     * @return:
     */
    List<CategoryBrandAttributesVO> queryCategoryBrandUnit(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);

    /*
     * @description:根据类目Id查询筛选属性
     * @author: chenyu.wang
     * @date: 2020-09-10
     * @return:
     */
    List<CategoryBrandAttributesVO> queryByCategoryId(@Param("categoryId") Long categoryId);

    /*
     * @description:商城询价页根据类目id获取品牌信息
     * @author: chenyu.wang
     * @date: 2020-09-17
     * @return:
     */
    List<CommodityInquiryBrandVO> queryInquiryBrandByCategoryId(@Param(value = "categoryId") Long categoryId);

    /*
     * @description:获取同级最大排序号
     * @author: chenyu.wang
     * @date: 2020-09-23
     * @return:
     */
    Integer getMaxSort(@Param(value = "parentId") Long parentId);

    /**
     * @Description: 查询类目品牌关联标签
     * @Author: chenyu.wang
     * @Params: [categoryId, brandId]
     * @Date: 2020.12.03 10:45
     */
    List<CategoryBrandAttributesVO> queryCategoryBrandLabel(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);

    /**
     * @return : java.util.List<com.ztgf.commodity.models.vo.CategoryExportQueryVO>
     * @Author :chenyu.wang
     * @Description : 查询要导出的类目数据
     * @Date : 09:51 2021.01.15
     * @Param : []
     **/
    List<CategoryExportQueryVO> queryCategoryExportList();
}
